1) Field of the Invention
This invention relates to an image processing apparatus and an image processing method for correcting distortion of an image (particularly a document image) inputted from an image inputting apparatus such as, for example, a handheld image scanner, as well as a computer-readable recording medium on which an image processing apparatus is recorded.
2) Description of the Related Art
Generally, an image scanner is utilized as an apparatus for inputting an image to an information processing apparatus such as a personal computer. Heretofore, a preinstalled image scanner of the flat bed type or the drum scanner type is used as an image scanner. Meanwhile, a simple image scanner (handheld image scanner) which can be carried readily and held with a hand of a user to scan an image has been developed and provided as a product in recent years.
FIG. 16 is a plan view showing a configuration of a popular handheld image scanner and particularly showing an original contacting face of the handheld image scanner. Referring to FIG. 16, the handheld image scanner 10 shown basically includes a line sensor 11 for taking an image, a plurality of (four in FIG. 16) rollers 12 for contacting with and rolling on an image original by a scanning operation by a user (operator), and a first-order rotary encoder (not shown) for detecting the speed of rotation of the rollers 12 to detect the amount of movement of the image scanner 10 by a scanning operation. The rollers 12 have a common axis of rotation and are rotated integrally with one another. The line sensor 11 has a fixed length W as a width in a main scanning direction thereof.
In order to use the image scanner 10 described above to take an image, the user will hold the image scanner 10 with its hand and move the image scanner 10 in a predetermined direction (sub scanning direction) along an image of a sample object. Thereupon, the rollers 12 are rotated in response to the movement of the image scanner 10, and the speed of rotation of the rollers 12 is detected by the encoder. Then, at a timing corresponding to the detected speed of rotation of the rollers 12, image data (hereinafter referred to as line image data) for one line in the main scanning direction are obtained. Such line image data are transmitted line by line from the image scanner to an information processing apparatus. Consequently, the image of the sample object is taken as image data, wherein a plurality of rows of line image data extending along the main scanning direction are arranged in the sub scanning direction, into the information processing apparatus.
Where the image of the sample object is a document image, the operation direction (sub scanning direction) of the image scanner 10 by the user is ideally parallel or perpendicular to the direction of a character row of the document.
However, the image scanner 10 does not particularly include a mechanism for controlling the direction of movement thereof so that it may move only in one direction with respect to the image of the sample object. However, when the image scanner 10 is actually operated for scanning by the user, the rollers 12 described above exert some constraining force to act in a direction in which the image scanner 10 may move along a direction of rotation of the rollers 12. Nevertheless, the constraining force is so weak that it cannot control the direction of movement of the image scanner 10 to one direction.
Accordingly, the degree of freedom in operation of the handheld image scanner 10 by the user is so high that the operation direction (direction of movement) for scanning of the image scanner 10 varies independently of the consciousness of the user and the image read by the scanning is very liable to suffer from distortion.
It is considered here to move the image scanner 10 toward the user to read, for example, an image original placed in front of the user.
In this instance, if the user who is right-handed holds the image scanner 10 with the right hand and performs a scanning operation, then as the image scanner 10 approaches the user, the arm moves such that the right elbow escapes in the rightward direction. As the arm moves in this manner, the operation direction of the image scanner 10 is liable to be displaced to the rightward direction a little as seen in FIG. 17A while the user is not conscious of this. Conversely, where the user is left-handed, the operation direction is liable to be displaced to the leftward direction. The image read by the image scanner 10 in this instance suffers from displacement, that is, distortion, in the direction of the line sensor (main scanning direction) depending upon the position of the operation direction (sub scanning direction).
Further, according to circumstances, as the arm moves in such a manner as described above, while the operation direction of the image scanner 10 is displaced in the rightward direction, simultaneously a slip sometimes occurs on one end side (on the left side in FIG. 17B) as seen in FIG. 17B. This makes the scanning region by the image scanner 10 have a sectoral shape. The image data read by the image scanner 10 then suffer from distortion not only in the line sensor direction (main scanning direction) but also the operation direction (sub scanning direction).
Thus, a technique has conventionally been proposed wherein a handheld image scanner has an optical two-dimensional sensor embedded therein and is used to two-dimensionally detect how the image scanner body moves on an image original and image data read by the handheld image scanner are corrected in response to a result of the detection. Here, the optical two-dimensional sensor traces very small concave and convex conditions on an image forming face of paper or the like to detect in what manner the image scanner body moves two-dimensionally after the scanning operation is started.
However, since such a two-dimensional sensor as described above is expensive, where the two-dimensional sensor is incorporated in an image scanner, although distortion of image data can be corrected, there is a subject to be solved in that a high production cost is required for the image scanner. Therefore, it is demanded to make it possible to estimate and correct distortion of image data obtained by a line sensor using the image data without newly adding a two-dimensional sensor or a like element.